﻿using IBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace ZG2RK10API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class RKController : ControllerBase
    {
        public RKController(IRKBLL bll)
        {
            Bll = bll;
        }

        public IRKBLL Bll { get; }
        [HttpPost]
        public Task<int> Add(yhmodel y)
        {
            return Bll.Add(y);
        }
        [HttpGet]
        public Task<int> Delete(int id)
        {
            return Bll.Delete(id);
        }
        [HttpGet]
        public dynamic GetAll(int pageindex, int pagesize)
        {
           return Bll.GetAll(pageindex, pagesize);
        }
        [HttpPost]
        public Task<int> Update(yhmodel y)
        {
            return Bll.Update(y);
        }
    }
}
